<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
$bar="List CV";
        echo '<table id="box-table-a" cellspacing="1" align="right" width="900px">';
        echo '<tr><td colspan=6 align=right class=bar>'.$bar.'</td></tr>';
        echo '<tr><td colspan=6 align=right class=pagination>'.$pagination.'</td></tr>';
        echo '
              <th>CV ID</th>
              <th>FullName</th>
              <th>FirstName</th>
              <th>LastName</th>
              <th>Number of Interview</th>
              <th>Action</th>';
        foreach($query as $row){
            //$images='<img src="'.base_url().'application/templates/images/'.$row->staff_avarta.'" width=100 height=70>';
            //$details = anchor("user/loadUpdateForm/$row->Staff_ID",$images);
            echo "<tr>
                        <td class=\"row10\">$row->CV_ID</td>
                        <td class=\"row12\">$row->FullName</td>
                        <td class=\"row10\">$row->FirstName</td>
                        <td class=\"row12\">$row->LastName</td>";
            $sql="select count(Result) as numberinterview from Interview where CV_ID=$row->CV_ID";
            $query1=$this->db->query($sql);
            foreach($query1->result() as $row1)
            {
                echo "<td class=\"row10\" align=\"center\">$row1->numberinterview</td>";
                /*if($row1->numberinterview<3)
                {*/
                    $titleChooseInterview = '<img src ="'.base_url().'templates/images/icons/select.jpeg" width=40 height=20 title="Click here to choose to interview"/>';
                    $choose = anchor("interview/loadFormInterview/$row->CV_ID",$titleChooseInterview);
                    $titleViewInterview = '<img src ="'.base_url().'templates/images/icons/view.gif" width=40 height=20 title="Click here to view interview"/>';
                    $view = anchor("interview/loadFormViewInterview/$row->CV_ID",$titleViewInterview);
                    $titleExperience = '<img src ="'.base_url().'templates/images/icons/ex.jpeg" width=40 height=20 title="Click here to add experience"/>';
                    $experience = anchor("CV/viewExperienceCV/$row->CV_ID",$titleExperience);
                    $titleUpdate = '<img src ="'.base_url().'templates/images/icons/edit.gif" title="Click here to modify"/>';
                    $update = anchor("CV/loadCVUpdateForm/$row->CV_ID",$titleUpdate);
                    $titleView = '<img src ="'.base_url().'templates/images/icons/view_salary.jpeg" width=20 height=20 title="Click here to view CV "/>';
                    $view_cv=anchor("CV/viewCV/$row->CV_ID",$titleView);
                    echo "<td class=\"row12\" align=\"center\">$update $view $choose $experience $view_cv</td></tr>";
                    echo "<td colspan=6 class=\"row1\" align=\"center\"><input type=\"hidden\" name=\"txtNumberInterview\" value=$row1->numberinterview></td></tr>";
                    
                /*}
                else
                {
                    $titleExperience = '<img src ="'.base_url().'templates/images/icons/ex.jpeg" width=40 height=20 title="Click here to add experience"/>';
                    $experience = anchor("CV/viewExperienceCV/$row->CV_ID",$titleExperience);
                    $titleViewInterview = '<img src ="'.base_url().'templates/images/icons/view.gif" width=40 height=20 title="Click here to choose to interview"/>';
                    $view = anchor("interview/loadFormViewInterview/$row->CV_ID",$titleViewInterview);
                    $titleUpdate = '<img src ="'.base_url().'templates/images/icons/edit.gif" title="Click here to modify"/>';
                    $update = anchor("CV/loadCVUpdateForm/$row->CV_ID",$titleUpdate);
                    $titleView = '<img src ="'.base_url().'templates/images/icons/view_salary.jpeg" width=20 height=20 title="Click here to view "/>';
                    $view_cv=anchor("CV/viewCV/$row->CV_ID",$titleView);
                    echo "<td class=\"row12\" align=\"center\">$update $view $experience $view_cv</td></tr>";
                }
                
            }
            
            /*$titleUpdate = '<img src ="'.base_url().'templates/images/icons/edit.gif" title="Click here to modify"/>';
            $titleDelete = '<img src ="'.base_url().'templates/images/icons/delete.png" title="Click here to delete"/>';
            //$titleActive = '<img src ="'.base_url().'application/templates/images/icons/active.jpg" title="Click here to active"/>';
            $titleView = '<img src ="'.base_url().'templates/images/icons/view.gif" height=25 title="Click here to view "/>';
            $titleInsertFamily = '<img src ="'.base_url().'templates/images/icons/insert_family.jpeg" width=40 height=25 title="Click here to insert family"/>';
            $update = anchor("staff/loadStaffUpdateForm/$row->Staff_ID",$titleUpdate);
            $delete = anchor("staff/deleteStaff/$row->Staff_ID",$titleDelete);
            //$active = anchor("user/loadConfirmForm/$row->Staff_ID",$titleActive);
            $view_staff=anchor("staff/viewInformationStaff/$row->Staff_ID",$titleView);
            $insert_family=anchor("staff/loadFormInsertFamily/$row->Staff_ID",$titleInsertFamily);*/
            }
            }
            $titleback = '<img src ="'.base_url().'templates/images/icons/back.jpg" width=40 height=25 title="Back"/>';
            $back = anchor("staff/index",$titleback);
            echo '<tr><td colspan=6 align=center>'. $back.'</td></tr>';
        echo '</table>';
?>
